<?php
/**
 * regd by PhpStorm.
 * User: lee
 * Date: 2017/11/29
 * Time: 17:31
 */

namespace Biz\validate;

use Biz\model\GoodsSkuAttr as mGoodsSkuAttr;


class GoodsSkuAttr extends \Doraemon\pockets\validate\Base {


    public static function rules() {
        $typeList = array_keys(mGoodsSkuAttr::$typeDesc);

        return [
            ['type','required',null,'SKU类型错误',['create','update']],
            ['type','InList',['list'=>$typeList],'SKU类型错误',['create','update']],

            ['title','required',null,'请填写SKU标题',['create','update']],
            ['title','length','1,40','请填写SKU标题',['create','update']],


            ['value','required',null,'请填写SKU值',['create','update']],
            ['value','length','1,40','请填写SKU值',['create','update']],



        ];

    }

}